package com.treasure.service.enums;

/**
 * @Auther: panxinwen
 * @Date: 2018/11/18 17:09
 * @Description:
 */
public enum SmsTemplate {

    LOGIN(1,"【生财有道】您的验证码为${},五分钟内有效，如非本人操作请忽略！"),
    PERFECTINFO(4,"【生财有道】您的验证码为${},五分钟内有效，如非本人操作请忽略！"),
    APPLY_CARD(101,"【生财有道】恭喜您成功升级为${}，享受更多权益，获取更多返利！");//办理会员

    private Integer code;
    private String template;

    SmsTemplate(int code, String template) {
        this.code=code;
        this.template=template;
    }

    public static String getTemplate(Integer code){

        for (SmsTemplate smsTemplate:values()){
            if (smsTemplate.getCode().intValue()==code.intValue()){
                return smsTemplate.getTemplate();
            }
        }

        return "";

    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getTemplate() {
        return template;
    }

    public void setTemplate(String template) {
        this.template = template;
    }
}
